<?php
$this->headTitle('Xem chi tiết thiết bị IT','append');
?>
<div class="grid grid_8">
    <div class="box-header">
    	<a class="add" href="<?php echo $this->url(array ('controller' => 'equipment' ,'action' => 'edit','id'=>$this->equipment['equipmentId']));	?>">
            Cập nhật
        </a>
    	<a class="add" href="<?php echo $this->url(array ('controller' => 'equipment' ,'action' => 'delete','id'=>$this->equipment['equipmentId']));	?>">
            Xóa Thiết Bị
        </a>
    </div>
    <div class="box box-content-equipment">
        <?php 
            foreach($this->arr_option_equipment as $row){
        ?>
		<div class="row">
			<div>
				<label>
						<?php echo $row['header'];?>
				</label>
				<?php echo $this->escape($this->equipment[$row['column']]); ?>
			</div>
		</div>
		<div class="clr"></div>
		<?php 
            } 
        ?>
		<div class="row">
            <div>
    			<label>Dự án sử dụng</label>			
				<?php
                    $stt = 1;
    				foreach($this->equipment['project'] as $project){
    				    if($stt == 1)
    					   echo $project['projectName'];
                        else
    					   echo "; ",$project['projectName'];
                        ++$stt;
                    }
				?>
            </div>
		</div>
		<div class="row">
    		<?php foreach ($this->equipment['item'] as $item){ ?>
				<div class="item">
					<div class="mTit">Thông tin thành phần thiết bị</div>
					<div class="content">
                    <?php 
                        foreach($this->arr_option_item as $row){
                    ?>
        				<label>
        						<?php echo $row['header'];?>
        				</label>
        				<?php 
                            if($row['column'] == 'priceItem')
                                echo number_format($item[$row['column']], 0, ',', '.')." VNĐ";
                            elseif($row['column'] == 'startDate')
                                echo $this->time()->dataToDate($item['startDate']);
                            else
                                echo $this->escape($item[$row['column']]); 
                        ?>
            		    <div class="clr"></div>
            		<?php 
                        } 
                    ?>
					</div>
				</div>
			<?php } ?>
		</div>
    	<div class="clr"> </div>
    </div>
</div>